namespace Gateway.IQuery;

public class PageResult<T> where T : class
{
    /// <summary>
    /// 数据
    /// </summary>
    public List<T> Rows { get; set; }

    /// <summary>
    /// 总页数
    /// </summary>
    public int Total { get; set; }

    public static PageResult<T> Create(List<T> data, int total)
    {
        return new PageResult<T>()
        {
            Rows = data,
            Total = total
        };
    }

    public static PageResult<T> Create(List<T> data)
    {
        return new PageResult<T>()
        {
            Rows = data,
            Total = 0
        };
    }
}